﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="LineDemo.aspx.cs" company="">
//   
// </copyright>
// <summary>
//   The line demo.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Ficharts.Net.Examples
{
    using System;
    using System.Web.UI;

    using Ficharts.Net.Enums;
    using Ficharts.Net.Examples.Code;

    /// <summary>
    /// The line demo.
    /// </summary>
    public partial class LineDemo : Page
    {
        #region Methods

        /// <summary>
        /// The page_ load.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.Chart.DataType = DataType.Xml;
                this.Chart.ChartTitle.Title = "2010年度销售额";
                this.Chart.ChartTitle.SubTitle = "呈上升趋势";
                this.Chart.Suffix.YSuffix = "万";
                this.Chart.XAxises.Add(new FieldAxis { Title = "月份" });
                this.Chart.YAxises.Add(new LinearAxis { Title = "销售额" });
                this.Chart.Series.Add(
                    new Line { XField = "Label", YField = "Value", LabelDisplay = LabelDisplayMode.normal });
                this.Chart.DataSource = ExampleData.DemoData1();
                this.Chart.DataBind();
            }
        }

        #endregion
    }
}